<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>盐类型 - 修改</title>
		<link charset="utf-8" rel="stylesheet" href="{:C('base')}/static/asset/bootstrap/3.3.6/css/bootstrap.min.css">
	</head>
	<body>
		<form action="{:U('manage/salt/edit')}" method="post" id="form-data" onsubmit="return check()">
		<table class="table table-bordered">
			<tr>
				<td>名称</td>
				<td>
					<input type="hidden" name="id" value="{$salt.id}">
					<input type="text" name="name" id="name" value="{$salt.name}">
				</td>
				<td>英文名称</td>
				<td>
					<input type="text" name="english_name" id="english_name" value="{$salt.english_name}">
				</td>
			</tr>
			<tr>
				<td>酸常量</td>
				<td>
					<input type="text" name="acid" value="{$salt.acid}">
				</td>
				<td>碱常量</td>
				<td>
					<input type="text" name="base" value="{$salt.base}">
				</td>
			</tr>

			<tr>
				<td colspan="6" class="text-right">
					<button type="reset" class="btn btn-default"> 重置 </button>
					<button type="submit" class="btn btn-primary"> 修改 </button>
				</td>
			</tr>
		</table>
		</form>
		
		<script src="{:C('base')}/static/asset/jquery/2.2.4/jquery.js"></script>
		<script>
			$(document).ready(function(){
				$('input[name=flag][value={$pi.flag}]').attr('checked', true);
			});
		</script>

		<script>
            function check(){
            	var name = $('#name').val();
				if(!name || name.length==0){
					alert('请输入盐名称');
					return false;
				}
				var englishName = $('#english_name').val();
				if(!englishName || englishName.length==0){
					alert('请输入盐的英文名称');
					return false;
				}
            	return true;
            }
		</script>
	</body>
</html>